@extends('layouts.wx')

@section('content')
<style>
.title {
    text-align: center;
    font-size: 34px;
    color: #3cc51f;
    font-weight: 400;
    margin: 0 15%;
}
  
</style>
<div class="weui-cells weui-cells_form" id="main">
    <h3 class="title">司机信息</h3>
    <form action="{{ route('driver.reg') }}" name="fm_order" method="post" onsubmit="return checkForm()">
        
        {{csrf_field()}}        
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">手机号</label></div>
            <div class="weui-cell__bd">
                {{$driver->phone}}
            </div>
            
        </div>  
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">姓名</label></div>
            <div class="weui-cell__bd">
                {{$driver->name}}
            </div>
        </div>  
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">车牌号</label></div>
            <div class="weui-cell__bd">
                {{$driver->car_no}}
            </div>
        </div>  
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">车型</label></div>
            <div class="weui-cell__bd">
                {{$driver->car_type}}
            </div>
        </div>  
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">线路</label></div>
            <div class="weui-cell__bd">
                {{$driver->line->title}}
            </div>
        </div> 
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">当前行程</label></div>
            <div class="weui-cell__bd">
                {{$driver->trip_text}}&nbsp;{{$driver->return_trip_title}}
            </div>
        </div>   
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">载客人数</label></div>
            <div class="weui-cell__bd">
                {{$driver->num}}
            </div>
        </div> 
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">剩余座位</label></div>
            <div class="weui-cell__bd">
                {{$driver->free}}
            </div>
        </div>        
    </form>
</div>
@endsection
@section('js')
<script>
    
    
    function  checkForm() {
        var phone = $('input[name="phone"]').val();
        if(!(/^1[3|4|5|8][0-9]\d{4,8}$/.test(phone))){
            alert("手机号码格式错误！");
            return false;
        }

        

        return true;
    }

    
</script>
@include('public.error')
@endsection
